home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / shells / tcshsrc.zoo / tcsh / tw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-25  |  3.7 KB  |  126 lines

  1. /* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tw.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */
  2. /*
  3.  * tw.h: TwENEX functions headers
  4.  */
  5. /*-
  6.  * Copyright (c) 1980, 1991 The Regents of the University of California.
  7.  * All rights reserved.
  8.  *
  9.  * Redistribution and use in source and binary forms, with or without
  10.  * modification, are permitted provided that the following conditions
  11.  * are met:
  12.  * 1. Redistributions of source code must retain the above copyright
  13.  *    notice, this list of conditions and the following disclaimer.
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in the
  16.  *    documentation and/or other materials provided with the distribution.
  17.  * 3. All advertising materials mentioning features or use of this software
  18.  *    must display the following acknowledgement:
  19.  *    This product includes software developed by the University of
  20.  *    California, Berkeley and its contributors.
  21.  * 4. Neither the name of the University nor the names of its contributors
  22.  *    may be used to endorse or promote products derived from this software
  23.  *    without specific prior written permission.
  24.  *
  25.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  26.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  27.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  28.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  29.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  30.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  31.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  32.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  33.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  34.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  35.  * SUCH DAMAGE.
  36.  */
  37. #ifndef _h_tw
  38. #define _h_tw
  39.  
  40. #ifdef BSDSIGS
  41.  
  42. # define FREE_ITEMS(items,num)\
  43. {\
  44.     sigmask_t omask;\
  45.     omask = sighold (SIGINT);\
  46.     free_items (items,num);\
  47.     items = NULL;\
  48.     (void) sigsetmask(omask);\
  49. }
  50.  
  51. # define FREE_DIR(fd)\
  52. {\
  53.     sigmask_t omask;\
  54.     omask = sighold (SIGINT);\
  55.     (void) closedir (fd);\
  56.     fd = NULL;\
  57.     (void) sigsetmask(omask);\
  58. }
  59.  
  60. #else
  61.  
  62. # define FREE_ITEMS(items,num)\
  63. {\
  64.     sighold (SIGINT);\
  65.     free_items (items,num);\
  66.     items = NULL;\
  67.     (void) sigrelse (SIGINT);\
  68. }
  69.  
  70. # define FREE_DIR(fd)\
  71. {\
  72.     sighold (SIGINT);\
  73.     (void) closedir (fd);\
  74.     fd = NULL;\
  75.     (void) sigrelse (SIGINT);\
  76. }
  77.  
  78. #endif
  79.  
  80. #ifndef TRUE
  81. # define TRUE        1
  82. #endif
  83. #ifndef FALSE
  84. # define FALSE        0
  85. #endif
  86. #define ON        1
  87. #define OFF        0
  88. #define FILSIZ        512    /* Max reasonable file name length */
  89. #define ESC        '\033'
  90. #define equal(a, b)    (strcmp(a, b) == 0)
  91.  
  92. #define is_set(var)    adrof(var)
  93.  
  94. #define BUILTINS    "/usr/local/lib/builtins/"    /* fake builtin bin */
  95. #define SEARCHLIST "HPATH"    /* Env. param for helpfile searchlist */
  96. #define DEFAULTLIST ":/usr/man/cat1:/usr/man/cat8:/usr/man/cat6:/usr/local/man/cat1:/usr/local/man/cat8:/usr/local/man/cat6"    /* if no HPATH */
  97.  
  98. extern Char PromptBuf[];
  99.  
  100. typedef enum {
  101.     LIST, RECOGNIZE, PRINT_HELP, SPELL, GLOB, GLOB_EXPAND,
  102.     VARS_EXPAND
  103. }       COMMAND;
  104.  
  105.  
  106. #define NUMCMDS_START 512    /* was 800 */
  107. #define NUMCMDS_INCR 256
  108. #define ITEMS_START 512
  109. #define ITEMS_INCR 256
  110.  
  111. #ifndef DONT_EXTERN
  112.  
  113. extern Char **command_list;    /* the pre-digested list of commands for speed
  114.                  * and general usefullness */
  115. extern int numcommands;
  116. extern int have_sorted;
  117. extern int non_unique_match;
  118.  
  119. extern Char dirflag[5];        /* ' nn\0' - dir #s -  . 1 2 ... */
  120.  
  121.  
  122. #endif
  123. #include "tw.decls.h"
  124.  
  125. #endif                /* _h_tw */
  126.